package com.bailiban.base.controller;

import com.bailiban.common.entity.Result;
import com.bailiban.common.entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhulang
 * @Classname BaseExceptionController
 * @Description BaseExceptionController
 */
@ControllerAdvice
public class BaseExceptionController {
    @ExceptionHandler
    @ResponseBody
    public Result exception(Exception e) {
        return new Result(false, StatusCode.ERROR, e.getMessage());
    }
}
